package com.fz.action;

import lombok.Data;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by webrx on 2017-09-13.
 */
@Data
public class Test {
    private String name;
    private String fn;

    public String source(){
        System.out.println();
        return "so";
    }

    public void ok(){
        System.out.println("hello-ok--"+name);
    }

    public void ss() throws IOException {
        HttpServletResponse res = ServletActionContext.getResponse();
        res.setCharacterEncoding("utf-8");
        res.setContentType("text/html;charset=utf-8");
        PrintWriter out = res.getWriter();
        out.print("<h1>Struts2.5.10 入门案例</h1>"+name);
        out.flush();
        out.close();
    }
}
